package designMode.structrueMode.adapter.obj;

import designMode.structrueMode.adapter.Source;
import designMode.structrueMode.adapter.Targetable;

/**
 * Created by Administrator on 2018/4/11.
 */
public class Adapter implements Targetable {

    private Source source;

    public Adapter(Source source) {
        this.source = source;
    }

    @Override
    public void method1() {
        source.method1();
    }

    @Override
    public void method2() {
        System.out.println("this is the targetable method!");
    }

    public static void main(String[] args) {
        Source source = new Source();
        Targetable target = new Adapter(source);
        target.method1();
        target.method2();
    }
}
